from math import log10
from itertools import count

def powers(a):
    nr = 0
    m = log10(a) - 1
    for n in count(1):
        if n * m >= -1: nr += 1
        else: break
        
    return nr

for x in range(1,10):
    print powers(x)

print sum(powers(x) for x in range(1,10))